using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

public class Behaviour_BKChange : MonoBehaviour
{
    public RectTransform BK_1;
    public RectTransform BK_2;
    public Vector2 Origin_3;
    public void Start()
    {
        BK_1.DOAnchorPos(BK_1.anchoredPosition+Vector2.left*5000,40f).SetEase(Ease.Linear);
        BK_2.DOAnchorPos(BK_2.anchoredPosition+Vector2.left*5000,40f).SetEase(Ease.Linear);
    }
    public void Update()
    {
        if(Vector2.Distance(BK_1.anchoredPosition,Vector2.zero) <= 50)
        {
            BK_2.DOComplete();
            BK_2.anchoredPosition = Origin_3;
            BK_2.DOAnchorPos(BK_2.anchoredPosition + Vector2.left * 10000, 80f).SetEase(Ease.Linear);
        }
        else if (Vector2.Distance(BK_2.anchoredPosition, Vector2.zero) <= 50)
        {
            BK_1.DOComplete();
            BK_1.anchoredPosition = Origin_3;
            BK_1.DOAnchorPos(BK_1.anchoredPosition + Vector2.left * 10000, 80f).SetEase(Ease.Linear);
        }
    }
    public void Awake()
    {
        Origin_3 = new Vector2 (3630,0);
    }
}
